﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="seal_order_detail_kumi.aspx.cs" Inherits="seal_seal_order_detail_kumi" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>シール注文書詳細</title>
    <meta   http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link type="text/css" rel="stylesheet" href="../css/global.css" />
    <script src="../js/jquery-1.6.min.js" type="text/javascript"></script>

</head>
<body leftmargin="20" topmargin="5" marginwidth="20" marginheight="5">


<%
    Kaidou.Model.LoginModel login = (Kaidou.Model.LoginModel)Session["loginModel"];
    Kaidou.Model.Order order = (Kaidou.Model.Order)Session["order"];
    Kaidou.Model.TrnJuchuh tjh = order.getJuchu_H();
    Kaidou.Model.TrnJuchud[] trn_model_d = order.getJuchu_D();
%>
	<table width="600" border="0" cellspacing="0" cellpadding="0" align="center">
		<tr> 
			<td> 
				<table width="600" border="0" cellspacing="0" cellpadding="0">
					<tr> 
						<td width="10">　</td>
						<td width="513"><h2>インターネット</h2>
							回胴式遊技機商業協同組合　事務局　</td>
						<td width="10">　</td>
					</tr>
					<tr> 
						<td colspan="3"> 
							<hr width="100%" size="1">
						</td>
					</tr>
				</table>
				<table width="600" border="0" cellspacing="2" cellpadding="2">
					<tr> 
						<td width="350">　</td>
						<td width="100"> 注文日：</td>
						<td width="150"><%=((DateTime)(tjh.JuchuDate)).ToString("yyyy年MM月dd日")%></td>
					</tr>
					<tr> 
						<td width="350">　</td>
						<td width="100"> 組合員コード：</td>
						<td width="150"><asp:Label ID="Unioncode" runat="server"></asp:Label></td>
					</tr>
					<tr> 
						<td width="350">　</td>
						<td width="100"> 組合員名：</td>
						<td width="150"><asp:Label ID="ParentOfficeName" runat="server"></asp:Label></td>
					</tr>
					<tr> 
						<td width="350">　</td>
						<td width="100"> 支店名：</td>
						<td width="150"><asp:Label ID="BranchOfficeName" runat="server"></asp:Label>
						</td>
					</tr>
					<tr> 
						<td width="350">　</td>
						<td width="100"> 注文担当者：</td>
						<td width="150"> <asp:Label ID="TRN_JUCHU_TANTO_NAME" runat="server"></asp:Label> 様</td>
					</tr>
				</table>
				<br>
				<table width="600" border="0" cellspacing="0" cellpadding="0">
					<tr height="50"> 
						<td width="33%" align="center"><font size="+2"><b><h1>確認シール注文書</h1> 
							</b></font> </td>
				</table>
				<br>
				<table width="600" border="0" cellspacing="0" cellpadding="0">
					<tr> 
						<td colspan="2"> 
							<p><b><font color="#666666">1.確認シール送付先</font></b></p>
						</td>
					</tr>
				</table>
				<br>
				<table width="50%" border="0" cellspacing="0" cellpadding="0" bgcolor="#999999">
					<tr> 
						<td width="0" height="0"> 
							
              <table width="100%" border="0" cellspacing="1" cellpadding="2">
                <tr> 
                	<td width="15%" bgcolor="#f0f0f0" nowrap>〒<%=login.Office_zip_no11 %>-<%=login.Office_zip_no21 %><br>
                	        <%=login.Office_pref1 %> <%=login.Office_city1 %> <%=login.Office_address1 %> <br>
						    TEL：<%=login.Office_tel1 %>  FAX:<%=login.Office_fax1 %></td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
				<br>
				<br>
				<table width="600" border="0" cellspacing="0" cellpadding="0">
					<tr> 
						<td colspan="2"> 
							<p><b><font color="#666666">2.注文内容</font></b></p>
						</td>
					</tr>
				</table>
				<br>
				<table width="600" border="0" cellspacing="2" cellpadding="2">
					<tr> 
						<td width="115">配達希望日</td>
						<%
                            string msg = "";

                            if (tjh.HopeDate != null)
                            {
                                DateTime dt1 = Convert.ToDateTime("1900-01-01");
                                DateTime dt2 = (DateTime)tjh.HopeDate;
                                if (DateTime.Compare(dt2, dt1) > 0)
                                {
                                    msg = ((DateTime)tjh.HopeDate).ToString("yyyy年MM月dd日");
                                }
                                else
                                {
                                    msg = "指定なし";
                                }

                            }
                            else
                            {
                                msg = "指定なし";
                            }
                                
						%>
						<td width="485"><%=msg %></td>
					</tr>
					<tr> 
						<td width="115">配達希望時間帯</td>
						<td width="485"><%=tjh.getHope_time_clss_mozi() %></td>
					</tr>
				</table>
				<br>
				・販売業者登録証番号の印字希望なしの場合<br>
				<table width="600" border="0" cellspacing="0" cellpadding="0" bgcolor="#999999">
					<tr> 
						<td width="0" height="0"> 
							
              <table width="100%" border="0" cellspacing="1" cellpadding="2">
                <tr> 
									<td bgcolor="#f0f0f0" width="60%"> 
										<div align="center">登録証番号</div>
									</td>
									<td bgcolor="#f0f0f0" width="10%"> 
										<div align="center">枚数</div>
									</td>
									<td bgcolor="#f0f0f0" width="30%"> 
										<div align="center">確認シール番号</div>
									</td>
								</tr>
	    
								<tr bgcolor="#FFFFFF"> 
									<td> 
										<div align="center">印字なし</div>
									</td>
									<td> 
										<div align="right"><%=(trn_model_d[0] == null) ? "" : (trn_model_d[0].SealQty <= 0 ? "" : "" + trn_model_d[0].SealQty)%>枚</div>
									</td>
									<td> 
										<div align="center">～</div>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
				<br>
				・販売業者登録証番号の印字希望ありの場合<br>
				<table width="600" border="0" cellspacing="0" cellpadding="0" bgcolor="#999999">
					<tr> 
						<td width="0" height="0"> 
							
              <table width="100%" border="0" cellspacing="1" cellpadding="2">
                <tr> 
									<td bgcolor="#f0f0f0" width="15%"> 
										<div align="center">登録証番号</div>
									</td>
									<td bgcolor="#f0f0f0" width="45%"> 
										<div align="center">会社名</div>
									</td>
									<td bgcolor="#f0f0f0" width="10%"> 
										<div align="center">枚数</div>
									</td>
									<td bgcolor="#f0f0f0" width="30%"> 
										<div align="center">確認シール番号</div>
									</td>
								</tr>
					
				<%
		            Kaidou.Persister.MST_TraderPersister traderDao = new  Kaidou.Persister.MST_TraderPersister();		    
                    for (int i = 1; i < 5; i++)
                    {
                        Kaidou.Model.TrnJuchud tjd= trn_model_d[i];
                        Kaidou.Model.MstTrader trader=null;
                        if( tjd!=null )
                        {
                            trader=traderDao.getDetail(tjd.TraderRegNo);
                        }
                            
                   
				 %>	
								<tr bgcolor="#FFFFFF"> 
									<td> 
										<div align="center"><%=tjd != null ? tjd.TraderRegNo.Substring(0, 2) + "-" + tjd.TraderRegNo.Substring(2, 5) : ""%></div>
									</td>
									<td>
										<div align="left"><%=trader!=null?trader.TraderName:"" %></div>
									</td>
									<td> 
										<div align="right"><%=tjd!=null?tjd.SealQty.ToString():"" %>枚</div>
									</td>
									<td> 
										<div align="center"><%=tjd != null?tjd.SealStrNo:""%> ～ <%=tjd != null?tjd.SealEndNo:""%></div>
									</td>
								</tr>
				<%} %>		
						
						
						
								<tr bgcolor="#FFFFFF"> 
									<td colspan="2" bgcolor="#f0f0f0"> 
										<div align="right">合計枚数</div>
									</td>
									<td> 
										<div align="right"><%=(tjh.TotalSealQty<=0)?"":""+tjh.TotalSealQty%>枚 </div>
									</td>
									<td> 
										<div align="center">～</div>
									</td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
				<br>

        <br>
				<br>
				
				<%
                    Kaidou.Persister.MST_UnionPersister dao1 = new Kaidou.Persister.MST_UnionPersister();
                    Kaidou.Persister.MST_Union_BranchPersister dao2 = new Kaidou.Persister.MST_Union_BranchPersister();
                    string hachu_union_name = "";
                    if (tjh.HachuUnionCode != null)
                    {
                        if (tjh.HachuBranchCode > 0)
                        {
                            Kaidou.Model.mst_union_branch m1 = dao2.getDetail(tjh.HachuUnionCode, tjh.HachuBranchCode);
                            hachu_union_name = m1 != null ? m1.officename : "";
                        }
                        else
                        {
                            Kaidou.Model.MstUnion m2 = dao1.getDetail(tjh.HachuUnionCode);
                            hachu_union_name = m2 != null ? m2.OfficeName : "";
                        }
                    }
		
				%>
				<table width="600" border="0" cellspacing="0" cellpadding="0" bgcolor="#999999">
					<tr> 
						<td width="0" height="0"> 
							
              <table width="100%" border="0" cellspacing="1" cellpadding="2">
                <tr bgcolor="#f0f0f0"> 
									<td width="50%" nowrap>発注（回胴遊商→印刷会社）</td>
									<td width="50%" nowrap>発送（印刷会社→組合員）</td>
								</tr>
								<tr bgcolor="#f0f0f0"> 
									<td width="50%" valign="top" nowrap>
									    発注日&nbsp;&nbsp;<%=tjh.HachuDate == null ? "" : ((DateTime)tjh.HachuDate).ToString("yyyy年MM月dd日")%><br>
										担当者&nbsp;&nbsp;<%=hachu_union_name%></td>
									<td width="50%" valign="top" nowrap>発送日&nbsp;&nbsp;<%= tjh.DelivDate == null ? "" : ((DateTime)tjh.DelivDate).ToString("yyyy年MM月dd日")%><br>
										担当者&nbsp;&nbsp;<%=tjh.DelivTantoName == null ? "" : tjh.DelivTantoName%><br>
										配送会社&nbsp;&nbsp;<%=tjh.DelivCompName == null ? "" : tjh.DelivCompName%><br>
										伝票番号&nbsp;&nbsp;<%=tjh.DelivNo == null ? "" : tjh.DelivNo%></td>
								</tr>
							</table>
						</td>
					</tr>
				</table>
				<br>
				
				<br>
				<table width="600" border="0" cellpadding=0 cellspacing=0>
					<tr> 
						<td> 
						     <input type="button" value="戻る" onClick="history.back()">
							
						</td>
					</tr>
				</table>
			</td>
		</tr>
	</table>
	<br>

	<br>
	<br>
	</body>
</html>